import instance from "./request";

const Api ={

    get :"GET",

    post :"PPOST",

    base : "https://wanandroid.com",

    login : "/harmony/index/json",

    exit : "/as/da/sd/a/sd/as/d/as/da/sd/as"
}



export const get=(uri:string, data : any) =>{
    return instance({    method: Api.get, url: uri , data :data})
}


export const post=(uri:string,data : any) =>{
    return instance({   method: Api.post,  url: uri , data :data})
}


//鸿蒙专栏
export const getHarmonyContent = () => {
    return instance({
        method: 'GET',
        url: '/harmony/index/json'
    })
}


export const getTest = () => {
    return instance({  method: 'GET', url: Api.login })
}




// 登录
export const login = (data: any) => {
    return instance({
        method: 'POST',
        url: '/auth/login',
        data:{

        }
    })
}

// 获取目录
export const getList = () => {
    return instance({
        method: 'GET',
        url: '/harmony/index/json'
    })
}

export const loginCode1 = (params: any) => {
    return instance({
        method: 'GET',
        url: '/auth/image_code',
        responseType: 'blob',  //用于数据是二进制数据，像是验证码、文件下载
        data: params
    })
}